package org.lztvn.elearning.entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "command")
public class Command implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 2856775800455555644L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long idCmd;
	
	private Date dateCmd;
   
	private String nameClient;
	private String telClient;
	private String mailClient;
	private String adressClient;
	private String cityClient;
	
	@OneToMany(mappedBy="cmd",cascade=CascadeType.REMOVE)
	private Collection<CommandeLine> lstCmdl;
	
	@ManyToOne
	@JoinColumn(name="idUser")
	private User user;
	
    
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Long getIdCmd() {
		return idCmd;
	}

	public void setIdCmd(Long idCmd) {
		this.idCmd = idCmd;
	}

	public Date getDateCmd() {
		return dateCmd;
	}

	public void setDateCmd(Date dateCmd) {
		this.dateCmd = dateCmd;
	}

	public Collection<CommandeLine> getLstCmdl() {
		return lstCmdl;
	}

	public void setLstCmdl(Collection<CommandeLine> lstCmdl) {
		this.lstCmdl = lstCmdl;
	}



	public String getNameClient() {
		return nameClient;
	}



	public void setNameClient(String nameClient) {
		this.nameClient = nameClient;
	}



	public String getTelClient() {
		return telClient;
	}



	public void setTelClient(String telClient) {
		this.telClient = telClient;
	}



	public String getMailClient() {
		return mailClient;
	}



	public void setMailClient(String mailClient) {
		this.mailClient = mailClient;
	}



	public String getAdressClient() {
		return adressClient;
	}



	public void setAdressClient(String adressClient) {
		this.adressClient = adressClient;
	}



	public String getCityClient() {
		return cityClient;
	}



	public void setCityClient(String cityClient) {
		this.cityClient = cityClient;
	}
	
	
	
	public Command() {
		super();
	}

	public Command(Date dateCmd, String nameClient, String telClient,
			String mailClient, String adressClient, String cityClient) {
		super();
		this.dateCmd = dateCmd;
		this.nameClient = nameClient;
		this.telClient = telClient;
		this.mailClient = mailClient;
		this.adressClient = adressClient;
		this.cityClient = cityClient;
	}


	
	
	
	
}
